package com.easyjoin.config;

import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
public class EasyForeignJacksonConfig {
    @Bean
    public Module dicTypeModule( DataSource dataSource) {
        SimpleModule module = new SimpleModule();
        module.setSerializerModifier(new EasyForeignBeanSerializerModifier( dataSource));
        return module;
    }
}
